#ifndef _FLASH_H_
#define _FLASH_H_

#include "stm32f103xe.h"

void init_flash(void);
void flash_unlock(void);
void flash_clear_flag(void);
void flash_erase_page(unsigned int page);
void flash_write_halfword(unsigned short *addr, unsigned short *data, unsigned int halfword_num);
void flash_lock(void);
void flash_read_halfword(unsigned short *addr, unsigned short *data, unsigned int halfword_num);

extern FLASH_TypeDef *flash;

#endif
